package com.asg.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.asg.dao.StudentMapper;
import com.asg.entity.Student;
import com.asg.service.StudentService;
@Service
public class StudentServiceImpl implements StudentService{
	@Autowired
	private StudentMapper studentMapper;

	@Override
	public List<Student> getList(Integer page, Integer limit, String studentName, Integer classId,String gender) {
		// TODO Auto-generated method stub
		return studentMapper.getList((page-1)*limit, limit, studentName,classId,gender);
	}

	@Override
	public int getCount(String studentName, Integer classId,String gender) {
		// TODO Auto-generated method stub
		return studentMapper.getCount(studentName, classId,gender);
	}

	@Override
	public int addStudent(Student student) {
		// TODO Auto-generated method stub
		return studentMapper.addStudent(student);
	}

	@Override
	public Student getStudentById(Integer studentId) {
		// TODO Auto-generated method stub
		return studentMapper.getStudentById(studentId);
	}

	@Override
	public int updateStudent(Student student) {
		// TODO Auto-generated method stub
		return studentMapper.updateStudent(student);
	}

	@Override
	public int delStudent(Integer studentId) {
		// TODO Auto-generated method stub
		return studentMapper.delStudent(studentId);
	}

}
